<template>
  <div>
    <div class="werapp">
      <div class="heard">
        <el-radio-group v-model="isCollapse" style="margin-bottom: 20px">
          <div class="ittem" @click="isCollapse = !isCollapse"></div>
        </el-radio-group>
        <h1>后台管理系统</h1>
      </div>
      <div class="footer">
        <div class="icon"></div>
        <div class="left">
          <el-menu
            default-active="1-4-1"
            class="el-menu-vertical-demo"
            :collapse="isCollapse"
          >
            <el-menu-item index="3">
              <i class="el-icon-document"></i>
              <span slot="title">图书管理</span>
            </el-menu-item>
            <el-menu-item index="2">
              <i class="el-icon-menu"></i>
              <span slot="title">后台管理</span>
            </el-menu-item>
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span slot="title">国际化</span>
              </template>
            </el-submenu>
            <el-menu-item index="4">
              <i class="el-icon-setting"></i>
              <span slot="title" @click="$router.push('/table')">基础表格</span>
            </el-menu-item>
            <el-menu-item index="5">
              <i class="el-icon-setting"></i>
              <span slot="title" @click="$router.push('/tab')">tab选项卡</span>
            </el-menu-item>
          </el-menu>
        </div>
        <div class="right">
          <router-view></router-view>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isCollapse: true,
    };
  },
};
</script>

<style lang="scss">
.werapp {
  height: 100vh;
  display: flex;
  flex-direction: column;
  .heard {
    height: 50px;
    color: white;
    background: rgba(24, 22, 44, 0.541);
    display: flex;
    line-height: 50px;
    .ittem {
      display: inline-block;
      width: 80px;
      height: 5px;
      padding: 10px 0;
      border-top: 5px solid;
      border-bottom: 5px solid;
      background-color: currentColor;
      background-clip: content-box;
      margin-left: 100px;
    }
    h1 {
      margin-left: 20px;
    }
  }
  .footer {
    flex: 1;
    display: flex;
    .left {
      background: pink;
      display: flex;
      flex-direction: column;
      text-align: center;
      a {
        text-decoration: none;
        color: black;
        height: 50px;
        line-height: 50px;
        &:active {
          background: rgb(125, 188, 215);
        }
      }
    }
    .right {
      flex: 1;
    }
  }
}
</style>
